{template 'common/header'}
<style>
.item{
	padding: 10px;
	border: 1px solid gainsboro;
	margin: 5px;
	width: 330px;
   	display: inline-block;
	position: relative;
	text-align: center;
}
.item img{
	width: 100%;
}
.item input{
	margin-top: 10px;
	display: inline;
}
.item input[type=text]{
	width: 65%;
}
.item input[type=number]{
	width: 30%;
	margin-right: 2%;
}
.item span{
	position: absolute;
	right: 0;
	font-size: 25px;
	color: red;
}
.item span:hover{
	font-size: 30px;
	border: 1px solid gainsboro;
	border-radius: 5px;
	background: black;
	cursor: pointer;
}
.img_group p{
	text-align: center;
}
.close2{
    float: right;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    filter: alpha(opacity=20);
    opacity: .2;
}
.lineimg img{
	width: auto !important;
}
</style>
<form action="" method="post" class="form form-horizontal">
<div class="panel panel-default">
	<div class="panel-heading">积分排行榜设置</div>
	<div class="panel-body">
		<div class="form-group">
         	<label class="col-xs-12 col-sm-3 col-md-2 control-label">前端标题</label>
         	<div class="col-sm-9">
             	<input class="form-control" name='data[title]' value='{php echo $set["title"]?$set["title"]:"积分排行榜"}'>
         	</div>
       	</div>
		<div class="form-group">
         	<label class="col-xs-12 col-sm-3 col-md-2 control-label">积分清零</label>
         	<div class="col-sm-9">
             	<a class="btn btn-danger btn-sm" onclick="return confirm('确定整个公众号所有粉丝积分都清零吗？操作将无法恢复！')" href='{php echo $this->createWebUrl("scoreclear")}'>点击积分清零</a>
         	</div>
       	</div>
       	<div class="form-group">
         	<label class="col-xs-12 col-sm-3 col-md-2 control-label">触发关键字</label>
         	<div class="col-sm-9">
             	<input class="form-control" name='data[kword]' value='{$set["kword"]}'>
         	</div>
       	</div>
       	<div class="form-group">
         	<label class="col-xs-12 col-sm-3 col-md-2 control-label">回复图文标题</label>
         	<div class="col-sm-9">
             	<input class="form-control" name='data[news][title]' value='{$set["news"]["title"]}'>
         	</div>
       	</div>
       	<div class="form-group">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label">回复图文图标</label>
            <div class="col-sm-9 col-xs-12">
                {php echo tpl_form_field_image('data[news][thumb]', $set["news"]["thumb"]);}
            </div>
        </div>
       	<div class="form-group">
         	<label class="col-xs-12 col-sm-3 col-md-2 control-label">回复图文概述</label>
         	<div class="col-sm-9">
             	<input class="form-control" name='data[news][desc]' value='{$set["news"]["desc"]}'>
         	</div>
       	</div>
       	<div class="form-group">
         	<label class="col-xs-12 col-sm-3 col-md-2 control-label">排行榜链接</label>
         	<div class="col-sm-9" style="padding-top: 7px;">
             	{php echo $_W['siteroot']."app".substr($this->createMobileUrl('scorerank'),1)}
         	</div>
       	</div>
       	<div class="form-group">
         	<label class="col-xs-12 col-sm-3 col-md-2 control-label">入口1地址</label>
         	<div class="col-sm-9">
             	<input class="form-control" name='data[cover1]' value='{$set["cover1"]}'>
         	</div>
       	</div>
       	<div class="form-group">
         	<label class="col-xs-12 col-sm-3 col-md-2 control-label">入口2地址</label>
         	<div class="col-sm-9">
             	<input class="form-control" name='data[cover2]' value='{$set["cover2"]}'>
         	</div>
       	</div>
       	
	</div>
</div>
<div class="panel panel-default">
 	<div class="panel-heading">banner设置</div>
 	<div class="panel-body">
		<span id="selectimage7" class="btn btn-primary"><i class="icon-plus"></i> 上传图片</span>
		<span class="btn btn-default"><i class="icon-plus"></i> 建议上传375*200大小一致的图片</span>
		<div id="listimage7" style="margin-top: 10px;">
		{loop $set['adv'] $p}
			<div class="item">
				<span onclick="$(this).parent().remove()" class="glyphicon">X</span>
				<img src="{php echo toimage($p['pic'])}">
				<input name="home_picurl[]" value="{$p['pic']}" type="hidden">
				<div>排序：<input placeholder="值越大，越前显示" class="form-control" name="home_sort[]" type="text" value="{$p['sort']}"></div>
				<div>链接：<input placeholder="请填网页跳转链接" class="form-control" name="home_link[]" type="text" value="{$p['link']}"></div>
			</div>
		{/loop}
		</div>
     </div>
	<script>     
	require(['jquery', 'util'], function($, util){
		$(function(){
			// 对象绑定点击事件
			$('#selectimage7').click(function(){
				util.uploadMultiPictures(function(list){
					// your code here
					for(var i=0; i<list.length; i++){
						var s = '<div class="item"><span onclick="$(this).parent().remove()" class="glyphicon">X</span>';
						s += '<img src="'+list[i]['url']+'">';
						s += '<input name="home_picurl[]" type="hidden" value="'+list[i]['filename']+'">';
						s += '<div>排序：<input placeholder="值越大，越前显示" class="form-control" name="home_sort[]" type="number"></div>';
						s += '<div>链接：<input placeholder="请填网页跳转链接" class="form-control" name="home_link[]" type="text"></div>';
						s += '</div>';
						$('#listimage7').append(s);
					}
				});
			});
		});
	});
	</script>
</div>
<button class="btn btn-primary" type="submit" name="submit" value="提交">提交</button>
<input type="hidden" name="token" value="{$_W['token']}">
</form>
<script>
function onAdd(obj){
	$(obj).parent().parent().before($('#model').html());
}
</script>
{template 'common/footer'}